#include <iostream>
#define N 100

using namespace std;

int delete_even(int array[], int elements){
int pos= elements/2;
int i;
elements -=1;
for(i=pos;i<elements;i++)
    array[i-1]=array[i+1];
    elements--;
return elements;

}

int delete_odd(int array[], int elements){
int pos= elements/2;
int i;
for(i=pos;i<elements;i++)
    array[i]=array[i+1];
    elements--;
return elements;
}

void readintVector(int array[], int elements){
for (int i=0; i<elements; i++){
	cout<<"a["<<i<<"]=";
	cin>>array[i];
	cout<<"\n";}
}

void printintVector(int array[], int even){
for(int i=0; i<even; i++){
	cout<<array[i]<<" ";}
	cout<<"\n";
}

void printVector(int array[], int odd){
for(int i=0; i<odd; i++){
	cout<<array[i]<<" ";}
	cout<<"\n";
}

int main(){
int array[N];
int elements;
int even;
int odd;
cout<<"Type the number of elements you want in the array: ";
cin>>elements;

readintVector(array, elements);

cout<<"The original array is ";
for(int i=0; i<elements; i++){
	cout<<array[i]<<" ";}
cout<<endl;

if(elements %2==0){
    even=delete_even(array, elements);
    cout<<"The new array with even elements is:";
    printintVector(array,even);}
else{
    odd=delete_odd(array, elements);
    cout<<"The new array with odd elements is:";
    printVector(array,odd);}

return 0;
}
